//== SAGITTARIUS ============================================================================

//== FILEDOC =========================================================================

/** @file pAST.h
  * @brief Abstract syntax tree for the parser
  */

//== BEGINNING OF CODE ===============================================================

#ifndef __SAGUTTARUIS__PARSER_NODES__H_
#define __SAGUTTARUIS__PARSER_NODES__H_

//== INCLUDES ========================================================================

#include "sagittarius/core/SagittariusCore.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief Prec of AST nodes
 */
typedef enum {
    SG_OP_LEAST,
    SG_OP_ADDSUB,
    SG_OP_DIVMUL,
    SG_OP_EXP
} sg_OpPrec;

/**
 * @brief Types of AST nodes
 */
typedef enum {
    ///Root of source tree
    PAST_NODE_TYPE_SRC,
    ///Function definition
    PAST_NODE_TYPE_FUNDEF,
    /// Terminal value
    //PAST_NODE_TYPE_TVALUE,
    /// Integral
    PAST_NODE_TYPE_UINT,
    /// Real
    PAST_NODE_TYPE_REAL,
    /// String
    PAST_NODE_TYPE_STR,
    /// LValue
    PAST_NODE_TYPE_SYMBOL,
    /// Fields access
    PAST_NODE_TYPE_FACCESS,
    /// RValue
    PAST_NODE_TYPE_RVALUE,
    /// RValue link
    PAST_NODE_TYPE_RVAL_LINK,
    /// Basic block link
    PAST_NODE_TYPE_BBLOCK_LINK,
    /// Assignment
    PAST_NODE_TYPE_ASSN,
    /// Call
    // symbol is stored
    // b is the argument
    PAST_NODE_TYPE_CALL,
    /// Import
    PAST_NODE_TYPE_IMPORT,
    /// Network
    PAST_NODE_TYPE_NETWORK,
    /// Reaction
    PAST_NODE_TYPE_RXN_RULE_LINK,
    /// Reaction
    PAST_NODE_TYPE_RXN_RULE,
    /// Reaction
    PAST_NODE_TYPE_RXN,
    /// Addition
    PAST_NODE_TYPE_ADD,
    /// Subtraction
    PAST_NODE_TYPE_SUB,
    /// Multiplication
    PAST_NODE_TYPE_MUL,
    /// Division
    PAST_NODE_TYPE_DIV,
    /// Exponentiation
    PAST_NODE_TYPE_EXP,
    /// Negation
    PAST_NODE_TYPE_NEG,
    /// Sentinel
    PAST_NODE_TYPE_TERMINAL_SENTINEL
} parserExpType;


#ifdef __cplusplus
}//extern "C"
#endif

#endif
